package com.android.bandroid.init;

import android.os.Bundle;
import android.os.Handler;

import com.android.bandroid.R;
import com.android.bandroid.base.BaseActivity;

import com.android.bandroid.guide.GuideActivity;

public class InitActivity extends BaseActivity {
    // 用于判断是否首次登陆, 默认首次登陆
    private static final int DURATION = 1500;
    private boolean isFirstIn = true;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_init);

        new Handler().postDelayed(new Runnable() {

            @Override
            public void run() {
                if (isFirstIn) {
                    /**
                     * 首次登陆,跳转到引导页
                     */
                    openActivity(GuideActivity.class);
                } else {
                    /**
                     * 非首次登陆,跳转到欢迎页
                     */
                    showToast("非首次登陆");
                }
                finish();
            }
        }, DURATION);
    }
}
